]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: fix code to detect missing unlock dialog
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 6 Nov 2012 22:41:51 +0000 (23:41 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 11 Nov 2012 18:17:58 +0000 (19:17 +0100)
If the session mode has no locking support, screenshield had code to
unlock automatically, but it did so by checking the return value of
the constructor, instead of checking if the constructor was actually
callable, so it would get a TypeError before reaching the check.

https://bugzilla.gnome.org/show_bug.cgi?id=687708

js/ui/screenShield.js

index 7c7c7c020d29514460442e2931961d1053d09d04..8de5c62455de875bc0adc046888440dca759b4e6 100644 (file)
@@ -713,13 +713,15 @@ const ScreenShield = new Lang.Class({
     _ensureUnlockDialog: function(onPrimary) {
         if (!this._dialog) {
             let constructor = Main.sessionMode.unlockDialog;
-            this._dialog = new constructor(this._lockDialogGroup);
-            if (!this._dialog) {
+            if (!constructor) {
                 // This session mode has no locking capabilities
                 this.unlock();
                 return;
             }
 
+            this._dialog = new constructor(this._lockDialogGroup);
+
+
             let time = global.get_current_time();
             this._dialog.connect('loaded', Lang.bind(this, function() {
                 if (!this._dialog.open(time, onPrimary)) {